from const import RESOURCE_PATH, PYLTP_MODEL_PATH


def read_config_path(path: str):
    """
    读取配置中的路径,
    目的是替换路径中存在的%RESOURCE_PATH%等定义在const.py里的变量
    :param path:
    :return: 绝对路径
    """
    path = path.replace('%RESOURCE_PATH%', RESOURCE_PATH)
    path = path.replace('%PYLTP_MODEL_PATH%', PYLTP_MODEL_PATH)
    return path
